package dataObjects;

/**
 * AbstractDoseId entity provides the base persistence definition of the DoseId
 * entity. @author MyEclipse Persistence Tools
 */

public abstract class AbstractDoseId implements java.io.Serializable {

	// Fields

	private String medicine;
	private String userName;

	// Constructors

	/** default constructor */
	public AbstractDoseId() {
	}

	/** full constructor */
	public AbstractDoseId(String medicine, String userName) {
		this.medicine = medicine;
		this.userName = userName;
	}

	// Property accessors

	public String getMedicine() {
		return this.medicine;
	}

	public void setMedicine(String medicine) {
		this.medicine = medicine;
	}

	public String getUserName() {
		return this.userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof AbstractDoseId))
			return false;
		AbstractDoseId castOther = (AbstractDoseId) other;

		return ((this.getMedicine() == castOther.getMedicine()) || (this
				.getMedicine() != null && castOther.getMedicine() != null && this
				.getMedicine().equals(castOther.getMedicine())))
				&& ((this.getUserName() == castOther.getUserName()) || (this
						.getUserName() != null
						&& castOther.getUserName() != null && this
						.getUserName().equals(castOther.getUserName())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getMedicine() == null ? 0 : this.getMedicine().hashCode());
		result = 37 * result
				+ (getUserName() == null ? 0 : this.getUserName().hashCode());
		return result;
	}

}